package com.example.demo.user.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @ClassName User
 * @Author l42142
 * @Date 2021/3/5 11:15
 * @Description TODO
 * @Version 1.0
 **/
@TableName("user")
public class User implements Serializable {
    private static final long serialVersionUID = -4212003308958757231L;
    @TableId("id")
    private String id;
    @TableField("username")
    private String name;
    @TableField("password")
    private String age;

    public User(String name, String age) {
        this.name = name;
        this.age = age;
    }

    public User(String id, String name, String age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public User() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        User user = (User) o;
        return Objects.equals(getId(), user.getId());
    }

    @Override
    public int hashCode() {
        return 1;
    }
}
